package cn.dnui_001zjs.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import cn.dnui_001zjs.dao.CategoryDao;
import cn.dnui_001zjs.po.Category;

@Service
public class CategoryService {
	@Autowired
	private CategoryDao categoryDao;

	public CategoryService() {
		// TODO Auto-generated constructor stub
	}

	public List<Category> getCatList() {
		// TODO Auto-generated method stub
		
		return categoryDao.getCateList();
	}
	//@Transactional(propagation=Propagation.REQUIRED)
	public int updateCatById(Category category){
		category.setCname("一日游"+System.currentTimeMillis());
		categoryDao.updateCatById(category);
		int i=1/0;
		category.setCid(2);
		category.setCname("两日游"+System.currentTimeMillis());
		categoryDao.updateCatById(category);
		return 1;
		
	}

}
